﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Data.SqlClient;

namespace proEx
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            this.Label1.Text = "xiugai";

            

            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string connectString = string.Format(@"Data Source=.\sqlexpress;Initial Catalog=master;Integrated Security=True");

            SqlConnection conn = new SqlConnection(connectString);
            SqlCommand cmd = conn.CreateCommand();
            cmd.CommandText = string.Format(@"select * from Users where username = '{0}'",this.TextBox1.Text);

            DataSet ds = new DataSet();
            SqlDataAdapter adapter = new SqlDataAdapter(cmd);
            adapter.Fill(ds);

            if (ds != null && ds.Tables != null && ds.Tables[0].Rows.Count > 0)
            {
                this.Label1.Text = ds.Tables[0].Rows[0]["PsssWord"].ToString();
            }
            else
            {
                this.Label1.Text = "no thing";
            }
        }

        
    }
}